﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Medianamik.Core;
using Medianamik.Core.Sugar;
using Telerik.Web.UI;
using Medianamik.Globalization;

namespace Medianamik.UI.ConfigManagement
{
    public partial class ControlList : BasePage
    {
        #region Events

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        #region Lock

        protected void LockLink_RequestFailed(object sender, CommandEventArgs e)
        {
            grdControls.Rebind();
            LockInfoTooltip.ObjectId = new Guid((string)e.CommandArgument);
            LockInfoTooltip.DataBind();
            LockInfoTooltip.Show();

        }

        protected void LockInfoTooltip_LockDeleted(object sender, EventArgs e)
        {
            grdControls.Rebind();
        }

        #endregion

        #region Grid

        protected void grdControls_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            grdControls.DataSource = ConfigManager.GetMedianamikControls();
        }

        protected void grdControls_DeleteCommand(object source, GridCommandEventArgs e)
        {
            throw new NotImplementedException();

            //Guid controlId;

            //if (StringHelper.IsGuid(e.CommandArgument.ToString(), out controlId))
            //{
                
            //}

            //grdControls.Rebind();
        }

        #endregion

        #endregion
    }
}